package com.yatuhashi.manual.mhp3.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import com.yatuhashi.manual.mhp3.R;
import com.yatuhashi.manual.mhp3.bean.QuestDetailBean;
import com.yatuhashi.manual.mhp3.custom.ViewHolder;

public class QuestDetailAdapter extends ArrayAdapter<QuestDetailBean>{
    LayoutInflater inflater;
    
    public QuestDetailAdapter(Context context) {
        super(context, 0);
        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }
    
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = new ViewHolder();
        
        if(convertView==null) {
            holder = new ViewHolder();
            convertView = inflater.inflate(R.layout.row_grid, null);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        
        
        return convertView;
    }
}
